/**
 * 改进代码
 * setTimeout(function () {
    var a = 'hello'
    setTimeout(function () {
        var b = 'lagou'
        setTimeout(function () {
            var c = 'I ❤ U'
            console.log(a + b + c);
        }, 10)
    }, 10)
}, 10)
 */

function stringJoin(str, defaultStr = '') {
    return new Promise(resolve => {
        setTimeout(() => {
            resolve(str + defaultStr)
        }, 10)
    })
}

stringJoin('hello')
    .then(str => stringJoin(str, 'lagou'))
    .then(str => stringJoin(str, 'I ❤ U'))
    .then(console.log)

